package avicit.bdp.dds.dao.entity;

import avicit.bdp.common.base.BaseDTO;
import avicit.platform6.core.annotation.log.Id;

import javax.persistence.Column;
import javax.persistence.Table;
import java.util.Objects;

/**
 * process instance map
 */
@Table(name="bdp_r_process_instance")
public class ProcessInstanceMap extends BaseDTO{

    /**
     * id
     */
	@Id
    @javax.persistence.Id
    @Column(name = "id")
    private String id;

    /**
     * parent process instance id
     */
    @Column(name = "parent_process_instance_id")
    private String parentProcessInstanceId;

    /**
     * parent task instance id
     */
    @Column(name = "parent_task_instance_id")
    private String parentTaskInstanceId;

    /**
     * process instance id
     */
    @Column(name = "process_instance_id")
    private String processInstanceId;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getParentProcessInstanceId() {
        return parentProcessInstanceId;
    }

    public void setParentProcessInstanceId(String parentProcessInstanceId) {
        this.parentProcessInstanceId = parentProcessInstanceId;
    }

    public String getParentTaskInstanceId() {
        return parentTaskInstanceId;
    }

    public void setParentTaskInstanceId(String parentTaskInstanceId) {
        this.parentTaskInstanceId = parentTaskInstanceId;
    }

    public String getProcessInstanceId() {
        return processInstanceId;
    }

    public void setProcessInstanceId(String processInstanceId) {
        this.processInstanceId = processInstanceId;
    }

    @Override
    public String toString() {
        return "ProcessInstanceMap{" +
                "id=" + id +
                ", parentProcessInstanceId=" + parentProcessInstanceId +
                ", parentTaskInstanceId=" + parentTaskInstanceId +
                ", processInstanceId=" + processInstanceId +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ProcessInstanceMap that = (ProcessInstanceMap) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(parentProcessInstanceId, that.parentProcessInstanceId) &&
                Objects.equals(parentTaskInstanceId, that.parentTaskInstanceId) &&
                Objects.equals(processInstanceId, that.processInstanceId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, parentProcessInstanceId, parentTaskInstanceId, processInstanceId);
    }
}
